package cate.game.role.bag.hero;

import com.fasterxml.jackson.annotation.JsonIgnore;
import easy.java.dev.note.NoteClass;
import easy.java.dev.note.NoteField;

@NoteClass(value = "英雄身上的锁")
public class Lock {
    @NoteField(value = "归属物的唯一ID")
    public String ownerUid;

    @NoteField(value = "归属物的物品大类")
    public byte ownerObjType;

    @NoteField(value = "手动锁定", detail = "比如：玩家点击英雄的锁按钮")
    public boolean manual = false;

    /** 是否被锁定 */
    public boolean islocked() {
        return manual || isCustomedLock();
    }

    @JsonIgnore
    protected boolean isCustomedLock(){
        return false;
    }

    public void initialize(String ownerUid, byte ownerObjType) {
        this.ownerUid = ownerUid;
        this.ownerObjType = ownerObjType;
    }

    public Lock copy() {
        Lock cp = new Lock();
        cp.manual = this.manual;
        return cp;
    }
}
